<!--
 * @Author: 卡卡 1071780426@qq.com
 * @Date: 2023-09-27 17:43:02
 * @LastEditors: 贺楠 1071780426@qq.com
 * @LastEditTime: 2024-10-21 16:18:38
 * @FilePath: \mould\src\components\BehaViorManage\feedbackListText\index.vue
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
  <!-- 小弹框 width:500,height:0.3,top:15%  -->
  <!-- 中弹框 width:800,height:0.5,top:10% -->
  <!-- 大弹框 width:1060,height:0.76,top:5% -->

  <div
    class="rawMaterial"
    id="tableInfoBox"
    style=" display: flex;
    flex-direction: column;!important"
  >
    <FormLyout @yj_saveForm="yj_saveForm" :isSave="btnShow">
      <template v-slot:formcon>
        <div
          class="dialogBody common commonClassDialog moduleDialog"
          :style="{ height: dialogHeight }"
          style="width: 100%"
        >
          <div class="tab">
            <div
              v-for="(data, index) in typeData"
              :key="data.value"
              @click="changeType($event, index)"
            >
              <div
                class="btn"
                :style="{
                  color:
                    data.show === true ? 'rgba(0, 117, 255, 1)' : '#343639',
                  background: data.show === true ? '#E0EFFF' : '#fff',
                }"
              >
                {{ data.text }}
              </div>
            </div>
          </div>
          <div
            v-if="typeData[0].show"
            style="display: flex; flex-direction: column"
          >
            <div class="baseTitle">生产厂家/供应商</div>
            <div class="baseTable">
              <publicForm1
                ref="publicForm"
                lableWidth="95px"
                :formObj="formObj"
                :formData="formData"
                @inputFocus="selectChange"
                @selectChange="selectChange"
                :selected="[]"
                @delteFile="delteFile"
                :timestamp="formData.supplierEmpower"
                :timestampa="formData.merchantReport"
                :timestampb="formData.merchantOther"
                :timestampc="formData.approvalProve"
                :timestampd="formData.supplierOther"
                :timestampe="formData.merchantLicense"
                :timestampf="formData.merchantProduction"
                :timestampg="formData.supplierLicense"



                :fileList="supplierEmpowerList"
                :fileList1="merchantReportList"
                :fileList2="merchantOtherList"
                :fileList3="approvalProveList"
                :fileList4="supplierOtherList"
                :fileList5="merchantLicenseList"
                :fileList6="merchantProductionList"
                :fileList7="supplierLicenseList"
                :submitStatus="submitStatus"
              >
              </publicForm1>
            </div>
            <div class="baseTitle">备案材料</div>
            <div class="postionTable">
              <el-table :data="tableData" style="width: 100%">
                <el-table-column label="序号" type="index" width="50">
                </el-table-column>
                <el-table-column
                  prop="varietyName"
                  label="材料种类"
                  align="center"
                >
                  <template slot-scope="scope">
                    <div class="inputminute">
                      <!-- <el-input
                          :disabled="true"
                          v-model="scope.row.varietyName"
                        ></el-input> -->

                      <el-select
                        v-model="scope.row.varietyName"
                        placeholder="请选择"
                        value-key="fId"
                        :disabled="isEdit"
                        @change="
                          function (item) {
                            return varietySelect(item, scope.$index, scope.row);
                          }
                        "
                      >
                        <el-option
                          v-for="item in scope.row.varietyData"
                          :key="item.fVarietyid"
                          :label="item.fVarietyname"
                          :value="item"
                        >
                        </el-option>
                      </el-select>
                    </div>
                  </template>
                </el-table-column>
                <el-table-column
                  prop="materialName"
                  label="材料名称"
                  align="center"
                >
                  <template slot-scope="scope">
                    <div class="selectobject">
                      <!-- {{scope.row}} -->
                      <el-select
                        placeholder="请选择"
                        v-model="scope.row.materialName"
                        value-key="fId"
                        :disabled="isEdit"
                        @change="
                          function (item) {
                            return selectMaterial(
                              item,
                              scope.$index,
                              scope.row,
                              scope.row.materialName
                            );
                          }
                        "
                      >
                        <el-option
                          v-for="(item, index) in scope.row.materialData"
                          :label="item.fMaterialname"
                          :value="item"
                          :key="index.fMaterialid"
                        >
                          <!-- :disabled="item.disabled" -->
                        </el-option>
                      </el-select>
                    </div>
                  </template>
                </el-table-column>
                <el-table-column
                  prop="specificationName"
                  label="规格型号"
                  align="center"
                  width="180"
                >
                  <template slot-scope="scope">
                    <div class="selectobject">
                      <el-select
                        placeholder="请选择"
                        v-model="scope.row.specificationName"
                        value-key="fId"
                        :disabled="isEdit"
                        @change="
                          function (item) {
                            return selectSpecification(
                              item,
                              scope.$index,
                              scope.row
                            );
                          }
                        "
                      >
                        <el-option
                          v-for="item in scope.row.specifications"
                          :label="item.fVersion"
                          :value="item"
                          :key="item.fVersionid"
                          :disabled="item.disabled"
                        >
                        </el-option>
                      </el-select>
                    </div>
                  </template>
                </el-table-column>

                <el-table-column
                  prop="filingLevel"
                  label="备案层级"
                  align="center"
                  width="140"
                >
                  <!-- <template slot-scope="scope">
                  <el-select v-model="scope.row.filingLevel" :disabled="isEdit">
                    <el-option label="建投公司" value="建投公司"></el-option>
                    <el-option label="指挥部" value="指挥部"></el-option>
                  </el-select>
                </template> -->
                </el-table-column>
                <el-table-column
                  prop="merchantData"
                  label="厂家证明资料"
                  align="center"
                >
                  <template slot-scope="scope">
                    <div class="upload">
                      <uploads
                        v-if="cndIndex == scope.$index"
                        :dialogUpload="dialogUpload"
                        @closes="closeDialog"
                        fileType="1"
                        :folderid="scope.row.merchantData"
                        @upFileList="getFile($event, scope.$index)"
                        :fileArray="scope.row.merchantDatas"
                        @delteFile="delteFile1($event, scope.$index, 0)"
                      >
                      </uploads>
                      <div class="img">
                        <div
                          v-for="(v, i) in scope.row.merchantDatas"
                          :key="i"
                          style="margin: 2px 3px; height: 87%"
                        >
                          <img
                            @click="openPdfs(v, i)"
                            v-if="scope.row.merchantDatas.length > 0"
                            src="@/assets/img/pdf.png"
                          />
                        </div>
                      </div>
                      <el-button
                        type="primary"
                        size="small"
                        :disabled="isEdit"
                        @click="clickUpload(scope.$index)"
                        >上传</el-button
                      >

                      <el-dialog
                        v-if="fileDetail != null"
                        :title="fileDetail.fFileName"
                        top="4vh"
                        :visible.sync="dialogVisibles"
                        width="50%"
                        @closes="dialogVisibles = false"
                      >
                        <div :style="{ height: '800px' }">
                          <iframe
                            :src="fileDetail.url"
                            width="100%"
                            height="100%"
                            frameborder="0"
                          ></iframe>
                        </div>
                      </el-dialog>
                    </div>
                  </template>
                </el-table-column>
                <el-table-column
                  prop="constructionReport"
                  label="施工单位检测报告"
                  align="center"
                >
                  <template slot-scope="scope">
                    <div class="upload">
                      <uploads
                        v-if="sgIndex == scope.$index"
                        :dialogUpload="sgdialogUpload"
                        @closes="sgcloseDialog"
                        fileType="1"
                        :folderid="scope.row.constructionReport"
                        @upFileList="sggetFile($event, scope.$index)"
                        :fileArray="scope.row.constructionReports"
                        @delteFile="delteFile1($event, scope.$index, 1)"
                      >
                      </uploads>
                      <div class="img">
                        <div
                          v-for="(v, i) in scope.row.constructionReports"
                          :key="i"
                          style="margin: 2px 3px; height: 87%"
                          @click="openPdfs(v, i)"
                        >
                          <img
                            v-if="scope.row.constructionReports.length > 0"
                            src="@/assets/img/pdf.png"
                          />
                        </div>
                      </div>
                      <el-button
                        type="primary"
                        size="small"
                        :disabled="isEdit"
                        @click="sgclickUpload(scope.$index)"
                        >上传</el-button
                      >
                      <!-- <pdfDialog
                      :dialogVisible="sgdialogVisibles"
                      @closes="sgdialogVisibles = false"
                      :fileDetail="sgfileDetail"
                    >
                    </pdfDialog> -->

                      <el-dialog
                        v-if="sgfileDetail != null"
                        :title="sgfileDetail.fFileName"
                        top="4vh"
                        :visible.sync="sgdialogVisibles"
                        width="50%"
                        @closes="sgdialogVisibles = false"
                      >
                        <div :style="{ height: '800px' }">
                          <iframe
                            :src="sgfileDetail.url"
                            width="100%"
                            height="100%"
                            frameborder="0"
                          ></iframe>
                        </div>
                      </el-dialog>
                    </div>
                  </template>
                </el-table-column>
                <el-table-column
                  prop="engineeringPart"
                  label="拟用工程部位"
                  align="center"
                  width="400"
                >
                  <template slot-scope="scope">
                    <div class="selectobjectPart">
                      <el-select
                        v-model="scope.row.engineeringPart"
                        multiple
                        placeholder="请选择"
                        :disabled="isEdit"
                      >
                        <el-option
                          label="路基工程"
                          value="路基工程"
                        ></el-option>
                        <el-option
                          label="路面工程"
                          value="路面工程"
                        ></el-option>
                        <el-option
                          label="桥梁工程"
                          value="桥梁工程"
                        ></el-option>
                        <el-option
                          label="隧道工程"
                          value="隧道工程"
                        ></el-option>
                        <el-option
                          label="房建工程"
                          value="房建工程"
                        ></el-option>
                        <el-option
                          label="交安工程"
                          value="交安工程"
                        ></el-option>
                        <el-option
                          label="机电工程"
                          value="机电工程"
                        ></el-option>
                      </el-select>
                    </div>
                  </template>
                </el-table-column>
                <el-table-column align="right" width="100">
                  <template slot="header">
                    <div class="customTable">
                      <el-button
                        type="primary"
                        :disabled="isEdit"
                        icon="el-icon-circle-plus-outline"
                        @click="addUnqualifiedInfo"
                      ></el-button>
                    </div>
                  </template>
                  <template slot-scope="scope">
                    <div class="customTable" style="padding-right: 37px">
                      <el-button
                        type="danger"
                        :disabled="isEdit"
                        icon="el-icon-delete"
                        @click="deleteUnqualifiedInfo(scope.$index, scope.row)"
                        circle
                      ></el-button>
                    </div>
                  </template>
                </el-table-column>
              </el-table>
            </div>
            <div class="baseTitle">备案申报</div>
            <div class="noteTable">
              <publicForm
                ref="publicForm1"
                lableWidth="95px"
                :formObj="additionalObj"
                :formData="formData"
                :selected="[]"
                @selectChange="selectChange"
              >
              </publicForm>
            </div>
            <div
              class="baseTitle"
              v-if="
                (formData.auditStatus == '已提交' ||
                  formData.auditStatus == '审核中') &&
                primaryInfo.status == 6
              "
            >
              处理情况
            </div>
            <div
              class="noteTable"
              v-if="
                (formData.auditStatus == '已提交' ||
                  formData.auditStatus == '审核中') &&
                primaryInfo.status == 6
              "
            >
              <publicForm2
                ref="publicForm2"
                lableWidth="95px"
                :formObj="handleObj"
                :formData="formData"
                :selected="[]"
                @selectChange="selectChange"
                @clickDialog="clickDialog"
              >
              </publicForm2>
            </div>
          </div>
          <div
            v-if="typeData[1].show"
            style="display: flex; flex-direction: column"
          >
  
            <!-- <div class="baseTitle" style="margin-bottom:10px">{{i.auditUnit}}审核</div> -->
<div style="margin-left:10px">
            <el-timeline :reverse="reverse">
              <el-timeline-item
              placement="top"
                v-for="(i, index) in auditData"
                :key="index"
                :timestamp="i.auditUnit+'审核,'+i.createDates"
              >
                <!-- {{activity.content}} -->

                <publicForm
                  ref="publicForm99"
                  lableWidth="95px"
                  :formObj="handleObj1"
                  :formData="i"
                  :selected="[]"
                  @selectChange="selectChange"
                  @clickDialog="clickDialog"
                >
                </publicForm>
              </el-timeline-item>
            </el-timeline>
          </div>
            
          </div>
        </div>
      </template>
    </FormLyout>

    <!-- 根据组织机构树选人 -->
    <el-dialog
      width="1060px"
      title="根据组织机构树选人"
      :visible.sync="dialogEditVisibleTree"
      :append-to-body="true"
      top="5%"
    >
      <div
        class="dialogBody common commonClassDialog moduleDialog"
        id="longLable"
        :style="{ height: '600px' }"
        style="width: 100%"
      >
        <div style="margin-bottom: 45px; height: 100%">
          <div
            class="publicForm addMemberCheckBox"
            style="height: calc(100% - 40px); overflow-y: auto; width: 100%"
          >
            <!-- <div class="addMemberCheckTree">
              <div class="companyBox">
                <el-tree
                  :data="companyInfo"
                  :props="defaultProps"
                  @node-click="selectCompany"
                  :highlight-current="highlightBd"
                ></el-tree>
              </div>
              <div class="departmentBox">
                <div
                  class="departmentTitle"
                  v-for="(item, index) in departmentList"
                  :key="index"
                  @click="seletDepartment(item, index)"
                >
                  <a
                    href="javascript:;"
                    :class="num === item.fDepartmentId ? 'activetext' : ''"
                    :title="item.fShortName"
                  >
                    {{ item.fShortName }}</a
                  >
                </div>
              </div>
            </div> -->

            <div class="addMemberCheckLeft">
              <el-radio-group
                v-model="checkboxGroup1"
                @change="selectRealname($event, personList)"
              >
                <el-radio-button
                  v-for="item in personList"
                  :label="item.fUserid"
                  :key="item.fUserid"
                  :value="item.fRealname"
                >
                  <div class="addMemberCheck">
                    <div class="MemberIcon">
                      <img :src="item.fGender == 0 ? girls : boys" alt="" />
                    </div>
                    <div class="MemberDetailInfos">
                      <div class="name">{{ item.fRealname }}</div>
                      <div class="hostName">{{ item.fDepartmentName }}</div>
                      <div class="hostName">{{ item.fAccount }}</div>
                    </div>
                  </div>
                </el-radio-button>
              </el-radio-group>
            </div>
          </div>
        </div>
      </div>
      <div class="newlyAdded_btn" v-if="btnShow">
        <el-button type="primary" @click="submitMember()">保存</el-button>
        <el-button type="warning" @click="dialogEditVisibleTree = false"
          >关闭</el-button
        >
      </div>
    </el-dialog>
    <!-- 根据组织机构树选人 -->
  </div>
</template>

<script src="./index.js"></script>
<style lang="less" scoped>
@import "./index.less";
</style>
